import 'package:flutter/material.dart';
import 'package:flutter_public/flutter_public.dart';

/// FileName bottom_bar
///
/// @Author lax
/// @Date 2025/3/3
///
/// @Description

class BottomBar extends StatelessWidget {
  final EdgeInsets? padding;

  final bool? visible;

  final Widget? child;

  const BottomBar({
    super.key,
    this.padding,
    this.visible,
    this.child,
  });

  @override
  Widget build(BuildContext context) {
    if (visible == false || !widgetIsVisible(child)) {
      return const SizedBox();
    }
    return Column(
      mainAxisSize: MainAxisSize.min,
      children: [
        ShadowContainer(
          width: double.infinity,
          padding: padding ?? SafeEdgeInsets.symmetric(horizontal: 16, vertical: 12),
          child: child,
        ),
      ],
    );
  }
}
